<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %> 
<!DOCTYPE html>
<html lang="zh-CN" >
<head>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>额度管理</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>

<body class="iframeBody">
<div class="Wrapper">
<div class="searchArea">
    <form id="searchBar">
        <div class="fieldset1 clearFix">
             <div class="fieldBox">
                <div class="label">省公司名称</div>
                <div class="field">
                    <input name="orgDispNm" id="orgDispNm" type="text" class="ui-textbox" value="">
                </div>
            </div>
            <%-- <div class="fieldBox">
                <div class="label">状态</div>
                <div class="field">
                    <select name="isValid" id="isValid">
                        <option value=" " seleted>请选择</option>
                        <c:forEach items="${isValidList }" var="isValid">
                        	<option value="${isValid.key }">${isValid.value }</option>
                        </c:forEach>
                    </select>
                </div>
            </div> --%>
            
            <div class="clearFix"></div>
            <div class="btnsBox">
                <span id="searchBtn" class="sq-button sq-button-round">查询</span>
                <span id="clearBtn" onclick="clearBtn();" class="sq-button sq-button-round">清空</span>
                <!-- <span id="addBtn" class="sq-button sq-button-round">新增</span>
                <span id="changeBtn" class="sq-button sq-button-round">修改</span>
                <span id="reSetPwdBtn" class="sq-button sq-button-round">密码重置</span> -->
            </div>
        </div>
    </form>
</div>
<div id="ligergrid" class="sq-grid"></div>
</div>

<script type="text/javascript">
var grid = null;
$(function () {	
	initData();
    $("#searchBar").ligerForm({
    });
    $("#searchBtn").click(function(event) {
         var form = liger.get("searchBar");
         var data = form.getData();
         //alert(JSON.stringify(data));
         for (name in data){
            grid.setParm(name, $.trim(data[name]));
         };
        grid.reload();
    });
});

function initData(){
	grid =  $("#ligergrid").ligerGrid({
    	url: '<%=path%>/brcrlit/prjBrCrLim/initList.do',
    	method : 'get',
        columns: [
            { display: '省公司名称', name: 'orgDispNm', minWidth: 140, 
            	render: function (rowdata, rowindex, value, column) { 
        		var h = '';
    		    h+='<a href="javascript:detailBtn(';
                h+="'"+rowdata.id+"'";
                h+=')">'+value+'</a>'
                return h;
    		},enabledSort:true},
            { display: '授信额度', name: 'crAmt', minWidth: 140,
    			render: function (rowdata, rowindex, value, column) { 
        		var h = (value/100).toFixed(2);
                return h+" 元";
    		}, enabledSort:true },
            { display: '授信类型', name: 'crTypCdNm', minWidth: 140 , enabledSort:true},
            { display: '剩余额度', name: 'leftAmt', minWidth: 140 ,
            	render: function (rowdata, rowindex, value, column) { 
        		var h = (value/100).toFixed(2);
                return h+" 元";
    		}, enabledSort:true},
    		{ display: '操作',
                isSort: false,
                width: 120,
                align:'center',
                render: function (rowdata, rowindex, value) { 
            		var h = '';
        		    h+='<a href="javascript:detailBtn(';
                    h+="'"+rowdata.id+"'";
                    h+=')">详情</a>'
                    return h;
        		}
            }
        ],
        pageSize:10,
        root:'rows',
        record:'total',
        hideLoadButton : true,
        width: '100%',
        isScroll: false,
        checkbox:false,
        rownumbers:true,
    });
}

function detailBtn(id){
	Add_navTab('tab_project_crd_list','信用额度使用详情','<%=path%>/brcrlit/prjBrCrLimRec/toCrDetailListPage.do?id='+id);
}

function clearBtn(){
    $("#searchBar").ligerForm();
			var form = new liger.get("searchBar");
			form.setData({
				orgDispNm:" "
			 });
	}

</script>
</body>
</html>
